package com.chenyuxin.ilp.exception;

import com.chenyuxin.ilp.model.enums.exception.BaseExceptionEnum;
import com.fasterxml.jackson.databind.ser.Serializers;
import lombok.Getter;

@Getter
public class BaseException extends RuntimeException{
    private Integer code;
    private String message;
    public BaseException(BaseExceptionEnum exceptionEnum) {
        super(exceptionEnum.getErrorMessage());
        this.code = exceptionEnum.getCode();
        this.message = exceptionEnum.getErrorMessage();
    }
    public BaseException(String errorMessage){
        this.code = 0;
        this.message = errorMessage;
    }
}
